<template>
  <template v-if="route.path === '/login' || route.path === '/register'|| route.path === '/'">
    <RouterView />
  </template>
  <template v-else>
    <DefaultLayout>
      <RouterView />
    </DefaultLayout>
  </template>
</template>

<script setup>
import { useRoute } from 'vue-router'
import DefaultLayout from '@/layouts/DefaultLayout.vue'
import { useAuthStore } from '@/stores/user'
import { onMounted } from 'vue'
const authStore = useAuthStore()
const route = useRoute()
onMounted(() => {
  authStore.initUser()
})
</script>